1. Field of the Invention
The present invention relates to an image forming apparatus and an image forming method that are capable of decompressing and compressing image data.
2. Description of the Related Art
Some conventional image processing apparatuses, such as digital cameras, have a trimming function of cutting a part of an image compressed and recorded in JPEG (Joint Photographic Experts Group) format, and recording the cut image.
In addition, some conventional image processing apparatuses have a function of rotating an image with respect to photographed image data so that the photographed image data can be displayed in a correct orientation according to a posture state taken at the time of photography recorded together with the photographed image data. Furthermore, some conventional image processing apparatuses are capable of applying zoom processing to an image so as to facilitate the entire image to be displayed even after the image is rotated.
In facsimile apparatuses, coding processing is performed by each scanning line in the sub scanning direction of an image for transmission. Accordingly, a high compression ratio can be obtained for an image in which a change in pixel values in the main scanning direction (on the same scanning line) is small as compared to a change in pixel values in the sub scanning direction. However, high compression ratios cannot be obtained for other images.
Therefore, some facsimile apparatuses are configured to apply rotation processing to image data before compression at a predetermined angle in an optional direction, to compare the amount of compressed data before rotation with the amount of compressed data after rotation, and to store the compressed data the amount of which is smaller.
Furthermore, in facsimile apparatuses, at the time of reading a document, the document size and the reading direction are detected by a document sensor and the detected information is stored together with compressed image data of the document into a document storage memory. At the time of transmission, it is determined whether to rotate image data for transmission, based on the performance of a transmission destination receiver and the document size and the reading direction stored in the document storage memory. If a result of determination indicates that the image data should be rotated, the image data is rotated at a predetermined angle before being compressed and transmitted.
In addition, in some printing control apparatuses, when no paper sheet of a predetermined size is available, switching may be made to another paper sheet size to perform printing. In this case, if the orientation of coded image data to be printed is different from the orientation of a designated paper sheet, the coded image data to be printed is decoded first, and the decoded image data is then rotated. After that, the rotated image data is coded again.
In a multifunctional image forming apparatus disclosed in Japanese Patent Application Laid-Open No. 11-112755, the amount of compressed data before rotation and the amount of compressed data after rotation are compared with each other, and the smaller of the two is selected. Accordingly, a reduction in image quality occurs. Therefore, such an apparatus is not suitable for outputting an image to a color printer or displaying an image on a display or the like.
In a color image communication apparatus disclosed in Japanese Patent Application Laid-Open No. 2004-193968, image data before coding and image data decoded after compression and coding are evaluated by an objective evaluation unit. If a result of evaluation indicates a value less than a predetermined level, a coding parameter is changed so as to heighten the quality of the decoded image data. Accordingly, a large computational cost and a long processing time are needed to perform processing. Therefore, such an apparatus is not applicable to a digital camera.